'use strict';

/**
 * 
 */
angular.module('app').controller('meCtrl',['$state','cache','$http','$scope',function ($state,cache,$http,$scope) {
    /**
     * 获取缓存
     */
    if(cache.get('name')){
        $scope.name = cache.get('name');
        $scope.image = cache.get('image');
    }
    /**
     * 退出：清除缓存
     */
    $scope.logout = function () {
        cache.remove('id');
        cache.remove('name');
        cache.remove('image');
        $state.go('main');
    }
}]);




